using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
//Download by http://www.codefans.net
namespace WindowsApplication1
{
    public partial class AttributeForm : Form
    {
        public AttributeForm()
        {
            InitializeComponent();
        }
        public string fileName = "";

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {

            string sourceName =labelLoction.Text+"\\" + fileName;
            string newName =labelLoction.Text+"\\" + textname.Text;
            if (fileName != textname.Text)
            {
                rename re = new rename(sourceName, newName);
            }

            this.Close();
        }


        public AttributeForm(string name, string loction, string type, string size, string objectss, string createTime, string Attribute)
        {
            InitializeComponent();
            fileName = name;
            labelLoction.Text = loction;
            textname.Text = name;
            labelType.Text = type;
            labelSize.Text = size;
            objects.Text = objectss;
            labelCreateTime.Text = createTime;
            labelAttribute.Text = Attribute;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sourceName = labelLoction.Text + "\\" + fileName;
            string newName = labelLoction.Text + "\\" + textname.Text;
            if (fileName != textname.Text)
            {
                rename re = new rename(sourceName, newName);
            }
        }



        //public void getFileName(string name, string loction, string type, string size, string objectss, string createTime, string Attribute)
        //{
        //    labelLoction.Text = loction;
        //    textname.Text = name;
        //    labelType.Text=type;
        //    labelSize.Text = size;
        //    objects.Text = objectss;
        //    labelCreateTime.Text = createTime;
        //    labelAttribute.Text = Attribute;
        //}

        //private void Attribute_Load(object sender, EventArgs e)
        //{
        //    //WindowsApplication1.ObjectAtrribute attri=new WindowsApplication1.ObjectAtrribute();
        //    this.textname.Text=MyDBOperator.Program
        //    //this.textname.Text = WindowsApplication1.ObjectAtrribute;
        //}
    }
}